﻿namespace System
{
    /// <summary>
    /// 列队消息
    /// <para>by tangjingbo at 2009/11/20 23:36</para>
    /// </summary>
    /// <typeparam name="TMessage">The type of the message.</typeparam>
    public interface IPendingMessage<TMessage>
    {
        /// <summary>
        /// 获取该列队消息是否有效
        /// </summary>
        bool IsValid();

        /// <summary>
        /// 获得方向
        /// </summary>
        MessageDirection GetDirection();

        /// <summary>
        /// 尝试得到结果
        /// </summary>
        IMessageResult<TMessage> TryGetResult();
    }
}